package com.ruoyi.repair.domain;

import com.fasterxml.jackson.annotation.JsonProperty;

public class MaintenanceRecord {

    // 报警代码（例如 ALM76、ALM12）
    private String alarmCode;

    // 发生频次
    private int frequency;

    // 总维修耗时
    @JsonProperty("TotalCompletionTime")
    private double totalCompletionTime;

    // 平均维修耗时
    @JsonProperty("AverageCompletionTime")
    private double averageCompletionTime;

    // 最长单次耗时
    @JsonProperty("LongTime")
    private double longTime;

    // 最短单次耗时
    @JsonProperty("ShortTime")
    private double shortTime;

    // 耗时方差
    private double variance;

    // 耗时标准差
    @JsonProperty("StandardDeviation")
    private double standardDeviation;


    // 无参构造方法（JSON 反序列化需要）
    public MaintenanceRecord() {}

    // 全参构造方法（可选）
    public MaintenanceRecord(String alarmCode, int frequency, double totalCompletionTime, 
                            double averageCompletionTime, double longTime, 
                            double shortTime, double variance, double standardDeviation) {
        this.alarmCode = alarmCode;
        this.frequency = frequency;
        this.totalCompletionTime = totalCompletionTime;
        this.averageCompletionTime = averageCompletionTime;
        this.longTime = longTime;
        this.shortTime = shortTime;
        this.variance = variance;
        this.standardDeviation = standardDeviation;
    }

    // Getter 和 Setter 方法
    public String getAlarmCode() {
        return alarmCode;
    }

    public void setAlarmCode(String alarmCode) {
        this.alarmCode = alarmCode;
    }

    public int getFrequency() {
        return frequency;
    }

    public void setFrequency(int frequency) {
        this.frequency = frequency;
    }

    public double getTotalCompletionTime() {
        return totalCompletionTime;
    }

    public void setTotalCompletionTime(double totalCompletionTime) {
        this.totalCompletionTime = totalCompletionTime;
    }

    public double getAverageCompletionTime() {
        return averageCompletionTime;
    }

    public void setAverageCompletionTime(double averageCompletionTime) {
        this.averageCompletionTime = averageCompletionTime;
    }

    public double getLongTime() {
        return longTime;
    }

    public void setLongTime(double longTime) {
        this.longTime = longTime;
    }

    public double getShortTime() {
        return shortTime;
    }

    public void setShortTime(double shortTime) {
        this.shortTime = shortTime;
    }

    public double getVariance() {
        return variance;
    }

    public void setVariance(double variance) {
        this.variance = variance;
    }

    public double getStandardDeviation() {
        return standardDeviation;
    }

    public void setStandardDeviation(double standardDeviation) {
        this.standardDeviation = standardDeviation;
    }

    // 可选：toString 方法（调试用）
    @Override
    public String toString() {
        return "MaintenanceRecord{" +
                "alarmCode='" + alarmCode + '\'' +
                ", frequency=" + frequency +
                ", totalCompletionTime=" + totalCompletionTime +
                ", averageCompletionTime=" + averageCompletionTime +
                ", longTime=" + longTime +
                ", shortTime=" + shortTime +
                ", variance=" + variance +
                ", standardDeviation=" + standardDeviation +
                '}';
    }
}